
<%@ page language="java"  contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>

<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/tld/struts-nested" prefix="nested"%>

<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt"%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>订单详情</title>
<link rel="stylesheet" type="text/css" href="/admin/css/public.css">
<link rel="stylesheet" type="text/css" href="/admin/css/manage.css">

<script  type="text/javascript"  language="javascript">
  //修改订单状态
function changeOrderState()
{
  //检查 状态是否修改正确
  var isok=false;
  var  orderStatutsForUpdate= document.getElementById("orderStatutsForUpdate").value;
  
  var oldStateName=document.getElementById("oldOrderStateName").value;
  
  var oldStateValue=document.getElementById("oldOrderStateValue").value;
  
  var stateList=document.getElementById("orderStatutsForUpdate");
  var stateNameLabel;
   var stateNameValue;
   
  for(var j=0;j<stateList.length;j++)
  {
			if(stateList[j].selected )
			{
			  stateNameLabel=stateList[j].text;
			  stateNameValue=stateList[j].value;
			}
   }
   
   
  
	    
  
  if(orderStatutsForUpdate!=null&&orderStatutsForUpdate!='-1')
  {
  //不能将已付款,已发货,已收货,状态修改成未付款状态
     if((oldStateName=='已付款订单' || oldStateName=='已发货订单' || oldStateName=='买家已收到货') && (stateNameLabel=='未付款订单') )
     {
	    alert('不能将已付款,已发货,已收货,状态修改成未付款状态');
        return false;
     }
     else
     {
        var ok=window.confirm("确认要修改订单的状态?");
	    if(ok)
	    {
	      isok=true;
	    }
     }
      
  
  }
  else
  {
    alert("订单状态必须选择");
  }
  
  if(isok)
  {
     var formObj=document.forms['orderManageFForm'];
     var link="/admin/orderManage/ebbOrderManageF.do?action=update&deal=changeOrderState";
      formObj.action=link;
       formObj.submit();
  }
 
}

//关闭交易
function closeMark()
{

	  var ok=window.confirm("确认要关闭交易?");
	    if(ok)
	    {
	      var formObj=document.forms['orderManageFForm'];
		 var link="/admin/orderManage/ebbOrderManageF.do?action=update&deal=closeOrder";
		 formObj.action=link;
		 formObj.submit();
	    }
    
}

//关闭本页面
function closeWindow()
{
var ok=window.confirm("确认要关闭页面?");
 if(ok)
 {
 window.close();
 }
  
}
</script>

</head>

<html:base/>

<body>
<div>
<%--<iframe  frameborder="0"  width= "100%" scrolling="no" src="top.jsp" height="66" allowTransparency="true"></iframe>--%>
</div>
<div style="height:8px; margin-top:-12px;"></div>
<div class="wzts">  </div>
<div>
  <%--<div class="main_left">
      <iframe  frameborder="0"  width= "100%" scrolling="no" src="left.jsp" height="1350"></iframe>
  </div>--%>
  <div class="main_content">
    <div class="box">
     <p> </p>
    </div>
			    <logic:present name="orderDetailExtendBean">
			    <html:form action="/admin/orderManage/ebbOrderManageF.do?action=update">
				   <table cellspacing="1" bgcolor="#FFDF78" class="flb box3">
					  <tr class="bg">
					    <td>图片</td>                                   
					    <td >商品名称</td>
						<td>市场价</td>
						<td>网上价</td>                          
						<td>数量</td>
						<td>金额小计</td>
						</tr>
						
						
						  <tr class="bg1">
						    <td><a href="/buyCarF.do?action=tobuyproducts&productId=${orderDetailExtendBean.products.id}"><img alt="商品图片" src="/fileUpload/products/${orderDetailExtendBean.proImgPath}" width="100px" height="100px"></img></a></td>
						    <td><c:out value="${orderDetailExtendBean.products.productsBase.names}"/></td>
							<td class="zs"><fmt:formatNumber pattern="###,###,##0.00">${orderDetailExtendBean.products.referencePrice}</fmt:formatNumber>元</td>
							<td class="zs"><fmt:formatNumber pattern="###,###,##0.00">${orderDetailExtendBean.products.price}</fmt:formatNumber>元</td>
							<td class="zs">${orderDetailExtendBean.pcounter}</td>
							<td class="zs"><fmt:formatNumber pattern="###,###,##0.00">${orderDetailExtendBean.pcounter * orderDetailExtendBean.products.price}</fmt:formatNumber>元</td>
						  </tr>
					</table>
					<table cellspacing="1" bgcolor="#FFDF78" class="flb box3">
					  <tr class="bg3">
					    <td width="102" bgcolor="FFEFBB">订单编号：</td>                                   
					    <td width="216" bgcolor="#FFFFFF" >${orderDetailExtendBean.id}</td>
						<td width="110" bgcolor="FFEFBB">下单时间：<br /></td>
						<td width="239" bgcolor="#FFFFFF">${orderDetailExtendBean.orderDetailTime}</td>                          
						</tr>
					  <tr class="bg3">
					    <td bgcolor="FFEFBB">收货人姓名：</td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.orderReciverInf.reciverName}</td>
						<td bgcolor="FFEFBB">E-Mail：</td>
						<td bgcolor="#FFFFFF" class="zs">${orderDetailExtendBean.orderReciverInf.reciverEmail}</td>
						</tr>
						<tr class="bg3">
					    <td bgcolor="FFEFBB">联系电话：</td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.orderReciverInf.reciverTel}</td>
						<td bgcolor="FFEFBB">手机：</td>
						<td bgcolor="#FFFFFF" class="zs">${orderDetailExtendBean.orderReciverInf.reciverMovb}</td>
						</tr>
						<tr class="bg3">
					    <td bgcolor="FFEFBB">详细地址：</td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.address}</td>
						<td bgcolor="FFEFBB">邮编：</td>
						<td bgcolor="#FFFFFF" class="zs">${orderDetailExtendBean.orderReciverInf.reciverPcode}</td>
						</tr>
						<tr class="bg3">
					    <td bgcolor="FFEFBB">付款方式：</td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.payAccount.bankName}</td>
						<td bgcolor="FFEFBB" >商品总金额：</td>
						<td bgcolor="#FFFFFF" class="zs">${orderDetailExtendBean.pcounter * orderDetailExtendBean.products.price}</td>
						</tr>
					  <tr class="bg3">
						<td bgcolor="FFEFBB">配送方式： </td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.deliveryPrice.deliveryType.deliveryTypeName}</td>
						<td bgcolor="FFEFBB">运费：</td><%--  1卖家支付 0买家支付 --%>
						<td bgcolor="#FFFFFF" class="zs"><c:if test="${orderDetailExtendBean.products.ifCost=='1'}">${orderDetailExtendBean.orderDetailPostPrice}</c:if>
						<c:if test="${orderDetailExtendBean.products.ifCost!='1'}">卖家支付</c:if></td>
					  </tr>
					  <tr class="bg3">
					    <td bgcolor="FFEFBB">订单总金额：</td>
					    <td bgcolor="#FFFFFF">${orderDetailExtendBean.orderDetailPrice}</td>
						<td bgcolor="FFEFBB">备注：</td>
						<td bgcolor="#FFFFFF" class="zs">&nbsp;</td>
						</tr>
					</table>
					<table cellspacing="1" bgcolor="#FFDF78" class="flb box3">
							  <tr class="bg3">
							    <td width="97" bgcolor="FFEFBB">管理订单状态</td>                                   
							    <td bgcolor="#FFFFFF" >
							    <input type="hidden" id="oldOrderStateName" value="${orderDetailExtendBean.orderStateName}">
							    <input type="hidden" id="oldOrderStateValue" value="${orderDetailExtendBean.orderStatuts}">
							      <html:select  property="orderStatutsForUpdate" value="${orderDetailExtendBean.orderStatuts}">
							        <html:option value="-1">订单状态</html:option>
							        <html:option value="1">未付款订单</html:option>
							        <html:option value="2">已付款订单</html:option>
							        <html:option value="3">已发货订单</html:option>
							        <html:option value="4">买家已收到货</html:option>
							      </html:select>
							        
							        <input  type="button" value=" " style="background-image: url('/admin/images/xgdazt.gif');border:0px;width:94px;height:20px;cursor:hand;" title="修改订单状态" onclick="return changeOrderState();"/>
							     </td>
								</tr>
							  <tr class="bg3">
							    <td bgcolor="FFEFBB">关闭交易原因</td>
							    <td bgcolor="#FFFFFF">
							      <html:textarea property="description" styleClass="textarea13">
							      </html:textarea>
							      
							      <input  type="button" value=" " style="background-image: url('/admin/images/gbjy.gif');border:0px;width:78px;height:20px;cursor:hand;" title="关闭交易" onclick="return closeMark();"/>
							       </td>
							  </tr>
					</table>
					
					
					<%--  隐藏参数  --%>
					<%--  订单详情id --%>
					<html:hidden property="orderDetailIdForUpdate" value="${orderDetailExtendBean.id}"/>
					
					<html:hidden name="request" property="bkAction" value="${bkAction}"/>
					<html:hidden name="request" property="bkOrderStatuts" value="${bkOrderStatuts}"/>
			</html:form>
			</logic:present>
					
					
		    <logic:notPresent name="orderDetailExtendBean">
		     <table cellspacing="1" bgcolor="#FFDF78" class="flb box3">
			  <tr class="bg">
			    <td>图片</td>                                   
			    <td >商品名称</td>
				<td>市场价</td>
				<td>网上价</td>                          
				<td>数量</td>
				<td>金额小计</td>
			 </tr>
			 <TR>
			  <TD colspan="6"><font color="red">数据不存在!</font></TD>
			 </TR>
			</table>
	 </logic:notPresent>

	<div  class="box3 center">
	
	</div>
  </div>
  
</div>
<div>
<%--<iframe  frameborder="0"  width= "100%" scrolling="no" src="foot.jsp"
height="100" allowTransparency="true"></iframe>--%>
</div>
</body>
</html:html>
